package daily.oct;

public class lc3100 {
    public int maxBottlesDrunk(int numBottles, int numExchange) {
        int emptyBottles = numBottles;
        int totalDrunk = numBottles;
        while (emptyBottles >= numExchange) {
            //每次换取一瓶水后，满瓶数量+1，(无需在代码中体现)
            //喝掉的水+1，交换数量+1
            //空瓶数量-换取数量,空瓶数量+1，
            emptyBottles -= numExchange;
            emptyBottles++;
            numExchange++;
            totalDrunk++;
        }

        return totalDrunk;
    }

    public static void main(String[] args) {
        lc3100 lc3100 = new lc3100();
        System.out.println(lc3100.maxBottlesDrunk(13, 6));
        System.out.println(lc3100.maxBottlesDrunk(10, 3));
    }
}
